<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkMenu</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="MenusAndCombos.html" title="菜单、组合框和工具栏">
<link rel="prev" href="gtk3-GtkComboBoxText.html" title="GtkComboBoxText">
<link rel="next" href="gtk3-GtkMenuBar.html" title="GtkMenuBar">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkComboBoxText.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkMenuBar.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkMenu.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkMenu.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkMenu"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkMenu.top_of_page"></a>GtkMenu</span></h2>
<p>GtkMenu — A menu widget</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkMenu.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu">GtkMenu</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenu.html#gtk-menu-new" title="gtk_menu_new ()">gtk_menu_new</a>                        (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-screen" title="gtk_menu_set_screen ()">gtk_menu_set_screen</a>                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/GdkScreen.html"><span class="type">GdkScreen</span></a> *screen</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-reorder-child" title="gtk_menu_reorder_child ()">gtk_menu_reorder_child</a>              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-attach" title="gtk_menu_attach ()">gtk_menu_attach</a>                     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> left_attach</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> right_attach</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> top_attach</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> bottom_attach</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-popup-for-device" title="gtk_menu_popup_for_device ()">gtk_menu_popup_for_device</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/GdkDevice.html"><span class="type">GdkDevice</span></a> *device</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_shell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_item</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> activate_time</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()">gtk_menu_popup</a>                      (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_shell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_item</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> activate_time</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-accel-group" title="gtk_menu_set_accel_group ()">gtk_menu_set_accel_group</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> *accel_group</code></em>);
<a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> *     <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-accel-group" title="gtk_menu_get_accel_group ()">gtk_menu_get_accel_group</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-accel-path" title="gtk_menu_set_accel_path ()">gtk_menu_set_accel_path</a>             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-accel-path" title="gtk_menu_get_accel_path ()">gtk_menu_get_accel_path</a>             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-title" title="gtk_menu_set_title ()">gtk_menu_set_title</a>                  (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-title" title="gtk_menu_get_title ()">gtk_menu_get_title</a>                  (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-monitor" title="gtk_menu_set_monitor ()">gtk_menu_set_monitor</a>                (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> monitor_num</code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-monitor" title="gtk_menu_get_monitor ()">gtk_menu_get_monitor</a>                (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-tearoff-state" title="gtk_menu_get_tearoff_state ()">gtk_menu_get_tearoff_state</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-reserve-toggle-size" title="gtk_menu_set_reserve_toggle_size ()">gtk_menu_set_reserve_toggle_size</a>    (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> reserve_toggle_size</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-reserve-toggle-size" title="gtk_menu_get_reserve_toggle_size ()">gtk_menu_get_reserve_toggle_size</a>    (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-popdown" title="gtk_menu_popdown ()">gtk_menu_popdown</a>                    (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-reposition" title="gtk_menu_reposition ()">gtk_menu_reposition</a>                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-active" title="gtk_menu_get_active ()">gtk_menu_get_active</a>                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-active" title="gtk_menu_set_active ()">gtk_menu_set_active</a>                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> index</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-tearoff-state" title="gtk_menu_set_tearoff_state ()">gtk_menu_set_tearoff_state</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> torn_off</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()">gtk_menu_attach_to_widget</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *attach_widget</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenuDetachFunc" title="GtkMenuDetachFunc ()"><span class="type">GtkMenuDetachFunc</span></a> detacher</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()">gtk_menu_detach</a>                     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-attach-widget" title="gtk_menu_get_attach_widget ()">gtk_menu_get_attach_widget</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
<a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="gtk3-GtkMenu.html#gtk-menu-get-for-attach-widget" title="gtk_menu_get_for_attach_widget ()">gtk_menu_get_for_attach_widget</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);
<span class="returnvalue">void</span>                (<a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()">*GtkMenuPositionFunc</a>)              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *x</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *y</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *push_in</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                (<a class="link" href="gtk3-GtkMenu.html#GtkMenuDetachFunc" title="GtkMenuDetachFunc ()">*GtkMenuDetachFunc</a>)                (<em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *attach_widget</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenu.description"></a><h2>Description</h2>
<p>
A <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> is a <a class="link" href="gtk3-GtkMenuShell.html#GtkMenuShell" title="struct GtkMenuShell"><span class="type">GtkMenuShell</span></a> that implements a drop down menu
consisting of a list of <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> objects which can be navigated
and activated by the user to perform application functions.
</p>
<p>
A <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> is most commonly dropped down by activating a
<a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> in a <a class="link" href="gtk3-GtkMenuBar.html#GtkMenuBar" title="struct GtkMenuBar"><span class="type">GtkMenuBar</span></a> or popped up by activating a
<a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> in another <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>.
</p>
<p>
A <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> can also be popped up by activating a <span class="type">GtkOptionMenu</span>.
Other composite widgets such as the <a class="link" href="gtk3-GtkNotebook.html#GtkNotebook" title="struct GtkNotebook"><span class="type">GtkNotebook</span></a> can pop up a
<a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> as well.
</p>
<p>
Applications can display a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> as a popup menu by calling the 
<a class="link" href="gtk3-GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()"><code class="function">gtk_menu_popup()</code></a> function.  The example below shows how an application
can pop up a menu when the 3rd mouse button is pressed.  
</p>
<p>
</p>
<div class="example">
<a name="id3598230"></a><p class="title"><b>Example 68. Connecting the popup signal handler.</b></p>
<div class="example-contents"><pre class="programlisting">
  /* connect our handler which will popup the menu */
  g_signal_connect_swapped (window, "button_press_event",
G_CALLBACK (my_popup_handler), menu);
</pre></div>
</div>
<p><br class="example-break">
</p>
<p>
</p>
<div class="example">
<a name="id3617633"></a><p class="title"><b>Example 69. Signal handler which displays a popup menu.</b></p>
<div class="example-contents"><pre class="programlisting">
static gint
my_popup_handler (GtkWidget *widget, GdkEvent *event)
{
  GtkMenu *menu;
  GdkEventButton *event_button;

  g_return_val_if_fail (widget != NULL, FALSE);
  g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
  g_return_val_if_fail (event != NULL, FALSE);

  /* The "widget" is the menu that was supplied when 
   * g_signal_connect_swapped() was called.
   */
  menu = GTK_MENU (widget);

  if (event-&gt;type == GDK_BUTTON_PRESS)
    {
      event_button = (GdkEventButton *) event;
      if (event_button-&gt;button == 3)
        {
          gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 
                          event_button-&gt;button, event_button-&gt;time);
          return TRUE;
        }
    }

  return FALSE;
}
</pre></div>
</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenu.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkMenu"></a><h3>struct GtkMenu</h3>
<pre class="programlisting">struct GtkMenu {
  GtkMenuShell menu_shell;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-new"></a><h3>gtk_menu_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_new                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-screen"></a><h3>gtk_menu_set_screen ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_screen                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/GdkScreen.html"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
<p>
Sets the <a href="../gdk3/GdkScreen.html"><span class="type">GdkScreen</span></a> on which the menu will be displayed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>screen</code></em> :</span></p></td>
<td>a <a href="../gdk3/GdkScreen.html"><span class="type">GdkScreen</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the screen should be
determined by the widget the menu is attached to. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-reorder-child"></a><h3>gtk_menu_reorder_child ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_reorder_child              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>);</pre>
<p>
Moves <em class="parameter"><code>child</code></em> to a new <em class="parameter"><code>position</code></em> in the list of <em class="parameter"><code>menu</code></em>
children.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>child</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> to move</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>the new position to place <em class="parameter"><code>child</code></em>.
Positions are numbered from 0 to n - 1</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-attach"></a><h3>gtk_menu_attach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_attach                     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> left_attach</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> right_attach</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> top_attach</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> bottom_attach</code></em>);</pre>
<p>
Adds a new <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> to a (table) menu. The number of 'cells' that
an item will occupy is specified by <em class="parameter"><code>left_attach</code></em>, <em class="parameter"><code>right_attach</code></em>,
<em class="parameter"><code>top_attach</code></em> and <em class="parameter"><code>bottom_attach</code></em>. These each represent the leftmost,
rightmost, uppermost and lower column and row numbers of the table.
(Columns and rows are indexed from zero).
</p>
<p>
Note that this function is not related to <a class="link" href="gtk3-GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()"><code class="function">gtk_menu_detach()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>child</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>left_attach</code></em> :</span></p></td>
<td>The column number to attach the left side of the item to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>right_attach</code></em> :</span></p></td>
<td>The column number to attach the right side of the item to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>top_attach</code></em> :</span></p></td>
<td>The row number to attach the top of the item to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bottom_attach</code></em> :</span></p></td>
<td>The row number to attach the bottom of the item to</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup-for-device"></a><h3>gtk_menu_popup_for_device ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_popup_for_device           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/GdkDevice.html"><span class="type">GdkDevice</span></a> *device</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_shell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_item</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> activate_time</code></em>);</pre>
<p>
Displays a menu and makes it available for selection.
</p>
<p>
Applications can use this function to display context-sensitive menus,
and will typically supply <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the <em class="parameter"><code>parent_menu_shell</code></em>,
<em class="parameter"><code>parent_menu_item</code></em>, <em class="parameter"><code>func</code></em>, <em class="parameter"><code>data</code></em> and <em class="parameter"><code>destroy</code></em> parameters. The default
menu positioning function will position the menu at the current position
of <em class="parameter"><code>device</code></em> (or its corresponding pointer).
</p>
<p>
The <em class="parameter"><code>button</code></em> parameter should be the mouse button pressed to initiate
the menu popup. If the menu popup was initiated by something other than
a mouse button press, such as a mouse button release or a keypress,
<em class="parameter"><code>button</code></em> should be 0.
</p>
<p>
The <em class="parameter"><code>activate_time</code></em> parameter is used to conflict-resolve initiation of
concurrent requests for mouse/keyboard grab requests. To function
properly, this needs to be the time stamp of the user event (such as
a mouse click or key press) that caused the initiation of the popup.
Only if no such event is available, <a class="link" href="gtk3-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()"><code class="function">gtk_get_current_event_time()</code></a> can
be used instead.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
<td>a <a href="../gdk3/GdkDevice.html"><span class="type">GdkDevice</span></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent_menu_shell</code></em> :</span></p></td>
<td>the menu shell containing the triggering
menu item, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent_menu_item</code></em> :</span></p></td>
<td>the menu item whose activation triggered
the popup, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>a user supplied function used to position the menu,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user supplied data to be passed to <em class="parameter"><code>func</code></em>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>destroy notify for <em class="parameter"><code>data</code></em>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>the mouse button which was pressed to initiate the event</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>activate_time</code></em> :</span></p></td>
<td>the time at which the activation event occurred</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup"></a><h3>gtk_menu_popup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_popup                      (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_shell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_item</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> activate_time</code></em>);</pre>
<p>
Displays a menu and makes it available for selection.
</p>
<p>
Applications can use this function to display context-sensitive
menus, and will typically supply <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the <em class="parameter"><code>parent_menu_shell</code></em>,
<em class="parameter"><code>parent_menu_item</code></em>, <em class="parameter"><code>func</code></em> and <em class="parameter"><code>data</code></em> parameters. The default menu
positioning function will position the menu at the current mouse
cursor position.
</p>
<p>
The <em class="parameter"><code>button</code></em> parameter should be the mouse button pressed to initiate
the menu popup. If the menu popup was initiated by something other
than a mouse button press, such as a mouse button release or a keypress,
<em class="parameter"><code>button</code></em> should be 0.
</p>
<p>
The <em class="parameter"><code>activate_time</code></em> parameter is used to conflict-resolve initiation
of concurrent requests for mouse/keyboard grab requests. To function
properly, this needs to be the timestamp of the user event (such as
a mouse click or key press) that caused the initiation of the popup.
Only if no such event is available, <a class="link" href="gtk3-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()"><code class="function">gtk_get_current_event_time()</code></a> can
be used instead.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent_menu_shell</code></em> :</span></p></td>
<td>the menu shell containing the
triggering menu item, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent_menu_item</code></em> :</span></p></td>
<td>the menu item whose activation
triggered the popup, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>a user supplied function used to position
the menu, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user supplied data to be passed to <em class="parameter"><code>func</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>the mouse button which was pressed to initiate the event.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>activate_time</code></em> :</span></p></td>
<td>the time at which the activation event occurred.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-accel-group"></a><h3>gtk_menu_set_accel_group ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_accel_group            (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> *accel_group</code></em>);</pre>
<p>
Set the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> which holds global accelerators for the
menu.  This accelerator group needs to also be added to all windows
that this menu is being used in with <a class="link" href="gtk3-GtkWindow.html#gtk-window-add-accel-group" title="gtk_window_add_accel_group ()"><code class="function">gtk_window_add_accel_group()</code></a>,
in order for those windows to support all the accelerators
contained in this group.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_group</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> to be associated
with the menu. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-accel-group"></a><h3>gtk_menu_get_accel_group ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> *     gtk_menu_get_accel_group            (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Gets the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> which holds global accelerators for the
menu. See <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-accel-group" title="gtk_menu_set_accel_group ()"><code class="function">gtk_menu_set_accel_group()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> associated with the menu. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-accel-path"></a><h3>gtk_menu_set_accel_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_accel_path             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);</pre>
<p>
Sets an accelerator path for this menu from which accelerator paths
for its immediate children, its menu items, can be constructed.
The main purpose of this function is to spare the programmer the
inconvenience of having to call <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-accel-path" title="gtk_menu_item_set_accel_path ()"><code class="function">gtk_menu_item_set_accel_path()</code></a> on
each menu item that should support runtime user changable accelerators.
Instead, by just calling <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-accel-path" title="gtk_menu_set_accel_path ()"><code class="function">gtk_menu_set_accel_path()</code></a> on their parent,
each menu item of this menu, that contains a label describing its
purpose, automatically gets an accel path assigned.
</p>
<p>
For example, a menu containing menu items "New" and "Exit", will, after
<code class="literal">gtk_menu_set_accel_path (menu, "&lt;Gnumeric-Sheet&gt;/File");</code>
has been called, assign its items the accel paths:
<code class="literal">"&lt;Gnumeric-Sheet&gt;/File/New"</code> and <code class="literal">"&lt;Gnumeric-Sheet&gt;/File/Exit"</code>.
</p>
<p>
Assigning accel paths to menu items then enables the user to change
their accelerators at runtime. More details about accelerator paths
and their default setups can be found at <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-entry" title="gtk_accel_map_add_entry ()"><code class="function">gtk_accel_map_add_entry()</code></a>.
</p>
<p>
Note that <em class="parameter"><code>accel_path</code></em> string will be stored in a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>. Therefore,
if you pass a static string, you can save some memory by interning
it first with <a href="../glib/glib-Quarks.html#g-intern-static-string"><code class="function">g_intern_static_string()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a valid <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>a valid accelerator path. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-accel-path"></a><h3>gtk_menu_get_accel_path ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_menu_get_accel_path             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Retrieves the accelerator path set on the menu.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a valid <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the accelerator path set on the menu.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-title"></a><h3>gtk_menu_set_title ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_title                  (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);</pre>
<p>
Sets the title string for the menu.
</p>
<p>
The title is displayed when the menu is shown as a tearoff
menu. If <em class="parameter"><code>title</code></em> is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the menu will see if it is attached
to a parent menu item, and if so it will try to use the same
text as that menu item's label.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>title</code></em> :</span></p></td>
<td>a string containing the title for the menu</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-title"></a><h3>gtk_menu_get_title ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_menu_get_title                  (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Returns the title of the menu. See <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-title" title="gtk_menu_set_title ()"><code class="function">gtk_menu_set_title()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the title of the menu, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the menu
has no title set on it. This string is owned by GTK+
and should not be modified or freed.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-monitor"></a><h3>gtk_menu_set_monitor ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_monitor                (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> monitor_num</code></em>);</pre>
<p>
Informs GTK+ on which monitor a menu should be popped up.
See <a href="../gdk3/GdkScreen.html#gdk-screen-get-monitor-geometry"><code class="function">gdk_screen_get_monitor_geometry()</code></a>.
</p>
<p>
This function should be called from a <a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a>
if the menu should not appear on the same monitor as the pointer.
This information can't be reliably inferred from the coordinates
returned by a <a class="link" href="gtk3-GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a>, since, for very long menus,
these coordinates may extend beyond the monitor boundaries or even
the screen boundaries.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>monitor_num</code></em> :</span></p></td>
<td>the number of the monitor on which the menu should
be popped up</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-monitor"></a><h3>gtk_menu_get_monitor ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gtk_menu_get_monitor                (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Retrieves the number of the monitor on which to show the menu.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of the monitor on which the menu should
be popped up or -1, if no monitor has been set</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-tearoff-state"></a><h3>gtk_menu_get_tearoff_state ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_menu_get_tearoff_state          (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Returns whether the menu is torn off.
See <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-tearoff-state" title="gtk_menu_set_tearoff_state ()"><code class="function">gtk_menu_set_tearoff_state()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the menu is currently torn off.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-reserve-toggle-size"></a><h3>gtk_menu_set_reserve_toggle_size ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_reserve_toggle_size    (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> reserve_toggle_size</code></em>);</pre>
<p>
Sets whether the menu should reserve space for drawing toggles
or icons, regardless of their actual presence.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>reserve_toggle_size</code></em> :</span></p></td>
<td>whether to reserve size for toggles</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.18</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-reserve-toggle-size"></a><h3>gtk_menu_get_reserve_toggle_size ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_menu_get_reserve_toggle_size    (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Returns whether the menu reserves space for toggles and
icons, regardless of their actual presence.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Whether the menu reserves toggle space</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.18</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popdown"></a><h3>gtk_menu_popdown ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_popdown                    (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Removes the menu from the screen.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-reposition"></a><h3>gtk_menu_reposition ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_reposition                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Repositions the menu according to its position function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-active"></a><h3>gtk_menu_get_active ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_get_active                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Returns the selected menu item from the menu.  This is used by the
<span class="type">GtkOptionMenu</span>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> that was last selected
in the menu.  If a selection has not yet been made, the
first menu item is selected. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-active"></a><h3>gtk_menu_set_active ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_active                 (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> index</code></em>);</pre>
<p>
Selects the specified menu item within the menu.  This is used by
the <span class="type">GtkOptionMenu</span> and should not be used by anyone else.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>index</code></em> :</span></p></td>
<td>the index of the menu item to select.  Iindex values are
from 0 to n-1</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-tearoff-state"></a><h3>gtk_menu_set_tearoff_state ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_set_tearoff_state          (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> torn_off</code></em>);</pre>
<p>
Changes the tearoff state of the menu.  A menu is normally
displayed as drop down menu which persists as long as the menu is
active.  It can also be displayed as a tearoff menu which persists
until it is closed or reattached.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>torn_off</code></em> :</span></p></td>
<td>If <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, menu is displayed as a tearoff menu.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-attach-to-widget"></a><h3>gtk_menu_attach_to_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_attach_to_widget           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *attach_widget</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenuDetachFunc" title="GtkMenuDetachFunc ()"><span class="type">GtkMenuDetachFunc</span></a> detacher</code></em>);</pre>
<p>
Attaches the menu to the widget and provides a callback function
that will be invoked when the menu calls <a class="link" href="gtk3-GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()"><code class="function">gtk_menu_detach()</code></a> during
its destruction.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>attach_widget</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu will be attached to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>detacher</code></em> :</span></p></td>
<td>the user supplied callback function
that will be called when the menu calls <a class="link" href="gtk3-GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()"><code class="function">gtk_menu_detach()</code></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-detach"></a><h3>gtk_menu_detach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_detach                     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Detaches the menu from the widget to which it had been attached.
This function will call the callback function, <em class="parameter"><code>detacher</code></em>, provided
when the <a class="link" href="gtk3-GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()"><code class="function">gtk_menu_attach_to_widget()</code></a> function was called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-attach-widget"></a><h3>gtk_menu_get_attach_widget ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_get_attach_widget          (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
Returns the <a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is attached to.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is attached to. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-for-attach-widget"></a><h3>gtk_menu_get_for_attach_widget ()</h3>
<pre class="programlisting"><a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             gtk_menu_get_for_attach_widget      (<em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>
Returns a list of the menus which are attached to this widget.
This list is owned by GTK+ and must not be modified.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the list
of menus attached to his widget. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkWidget][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenuPositionFunc"></a><h3>GtkMenuPositionFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkMenuPositionFunc)              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *x</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *y</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *push_in</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
A user function supplied when calling <a class="link" href="gtk3-GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()"><code class="function">gtk_menu_popup()</code></a> which
controls the positioning of the menu when it is displayed.  The
function sets the <em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em> parameters to the coordinates where the
menu is to be drawn.  To make the menu appear on a different
monitor than the mouse pointer, <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-monitor" title="gtk_menu_set_monitor ()"><code class="function">gtk_menu_set_monitor()</code></a> must be
called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>address of the <a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> representing the horizontal
position where the menu shall be drawn. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>address of the <a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> representing the vertical position
where the menu shall be drawn.  This is an output parameter. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>push_in</code></em> :</span></p></td>
<td>This parameter controls how menus placed outside
the monitor are handled.  If this is set to <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> and part of
the menu is outside the monitor then GTK+ pushes the window
into the visible area, effectively modifying the popup
position.  Note that moving and possibly resizing the menu
around will alter the scroll position to keep the menu items
"in place", i.e. at the same monitor position they would have
been without resizing.  In practice, this behavior is only
useful for combobox popups or option menus and cannot be used
to simply confine a menu to monitor boundaries.  In that case,
changing the scroll offset is not desirable. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>the data supplied by the user in the <a class="link" href="gtk3-GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()"><code class="function">gtk_menu_popup()</code></a>
<em class="parameter"><code>data</code></em> parameter.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenuDetachFunc"></a><h3>GtkMenuDetachFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkMenuDetachFunc)                (<em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *attach_widget</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>
A user function supplied when calling <a class="link" href="gtk3-GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()"><code class="function">gtk_menu_attach_to_widget()</code></a> which 
will be called when the menu is later detached from the widget.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>attach_widget</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is being detached from.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkMenu.html#GtkMenu" title="struct GtkMenu"><span class="type">GtkMenu</span></a> being detached.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>